package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLPoint;
import HLLib.base.HLRectangle;

public class HLClassRectangle extends HLLibClass {
    public HLClassRectangle(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLRectangle();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                ((HLRectangle) self).IsEmpty();
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLRectangle) self).IsEmpty());
            }
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                ((HLRectangle) self).GetBottom();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLRectangle) self).GetBottom());
            }
            break;
        }
        case 2: {
            if (resultOwnerObject == null) {
                ((HLRectangle) self).GetRight();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLRectangle) self).GetRight());
            }
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                ((HLRectangle) self).GetSize();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLRectangle) self).GetSize());
            }
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                ((HLRectangle) self).IsContainsPoint((HLPoint)args.GetObject(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLRectangle) self).IsContainsPoint((HLPoint)args.GetObject(0)));
            }
            break;
        }
        case 5: {
            if (resultOwnerObject == null) {
                ((HLRectangle) self).IsContainsPoint1(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLRectangle) self).IsContainsPoint1(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 6: {
            if (resultOwnerObject == null) {
                ((HLRectangle) self).IsContainsRect((HLRectangle)args.GetObject(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLRectangle) self).IsContainsRect((HLRectangle)args.GetObject(0)));
            }
            break;
        }
        case 7: {
            if (resultOwnerObject == null) {
                ((HLRectangle) self).IsContainsRect1(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLRectangle) self).IsContainsRect1(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3)));
            }
            break;
        }
        case 8: {
            ((HLRectangle) self).Intersect((HLRectangle)args.GetObject(0));
            break;
        }
        case 9: {
            ((HLRectangle) self).Intersect1(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3));
            break;
        }
        case 10: {
            if (resultOwnerObject == null) {
                ((HLRectangle) self).IsIntersectsWith((HLRectangle)args.GetObject(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLRectangle) self).IsIntersectsWith((HLRectangle)args.GetObject(0)));
            }
            break;
        }
        case 11: {
            if (resultOwnerObject == null) {
                ((HLRectangle) self).IsIntersectsWith1(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLRectangle) self).IsIntersectsWith1(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3)));
            }
            break;
        }
        case 12: {
            ((HLRectangle) self).Union((HLRectangle)args.GetObject(0));
            break;
        }
        case 13: {
            ((HLRectangle) self).Union1(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3));
            break;
        }
        }
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                HLRectangle.IsRectContainsPoint(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3), args.GetInt(4), args.GetInt(5));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, HLRectangle.IsRectContainsPoint(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3), args.GetInt(4), args.GetInt(5)));
            }
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                HLRectangle.IsRectContainsPoint1(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3), args.GetInt(4), args.GetInt(5));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, HLRectangle.IsRectContainsPoint1(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3), args.GetInt(4), args.GetInt(5)));
            }
            break;
        }
        }
    }
}
